#! /usr/bin/python
# coding: utf-8

from Tkinter import *

root = Tk()

def printEvent(event):
    print '<Key>', event.keycode

def printReturn(event):
    print '<Return>', event.keycode

root.bind('<Key>', printEvent)
root.bind('<Return>', printReturn)

root.mainloop()
